﻿using System.ComponentModel.DataAnnotations;
using ServiceStack.DataAnnotations;

namespace NetSurveillance.WebApp.DataServices.Models
{
    [Alias("RemoteServers")]
    public class RemoteServer : BaseModel
    {
        [AutoIncrement]
        public long Id { get; set; }

        [RegularExpression(@"^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$", ErrorMessage = "IP格式不正确")]
        [Required(AllowEmptyStrings = false)]
        [StringLength(32)]
        public string Ip { get; set; }

        public int Port { get; set; }

        [Required(AllowEmptyStrings = false)]
        [StringLength(30)]
        public string Username { get; set; }

        [StringLength(200)]
        public string Pass { get; set; }
    }
}